<template>
	<view class="self-card-component">
		<view class="self-card-body">
			<view class="self-card-model">
				<view class="model-image">
					<image
						v-if="info.productLogo"
						:src="info.productLogo"
						class="icon-model"
					></image>
					<view
						v-if="info.evaType === '1'"
						class="model-type"
					>
						<image
							src="@/static/images/icon_self_tag.png"
							mode="widthFix"
							class="icon-self-tips"
						></image>
					</view>
					<view
						v-else-if="info.evaType === '2'"
						class="model-type"
					>
						<image
							src="@/static/images/icon_history_tag.png"
							mode="widthFix"
							class="icon-tips"
						></image>
					</view>
					<view
						v-else-if="info.productId"
						class="model-type"
					>
						<image
							src="@/static/images/icon_hot_tag.png"
							mode="widthFix"
							class="icon-tips"
						></image>
					</view>
				</view>
				<view class="model-data">
					<template
						v-if="info.productId"
					>
						<view class="model-prices">最高可卖 <text class="currency">¥</text><text class="prices">{{ info.productMaxPrice / 100 || 0 }}</text></view>
						<view class="model-name">{{ info.productName }}</view>
					</template>
				</view>
				<view class="model-evaluate">
					<view
						class="other-evaluate"
						@click="$emit('recycle', {})"
					>
						<text>其他机型</text>
						<image
							src="@/static/images/icon_model_more.png"
							class="icon-more"
						></image>
					</view>
					<view class="evaluate-btn" @click="$emit('recycle', info)">立即换钱</view>
				</view>
			</view>
			<view class="self-card-bottom">
				<view v-if="info.profitInfo && info.profitInfo.addPrice" class="recycle-discounts">
					<view class="discounts-name">限时优惠</view>
					<view class="discounts-prices">{{ info.profitInfo.desc }}<text class="prices-txt">¥{{ info.profitInfo.addPrice / 100 || 0 }}</text></view>
					<view class="discounts-time">1天14:23:00后失效</view>
				</view>
				<view
					v-else-if="info.orderList && info.orderList.length"
					class="recycle-swiper"
				>
					<swiper
						circular
						class="recycle-swiper-content"
						:vertical="true"
						:indicator-dots="false"
						:autoplay="true"
						:interval="2000"
						:duration="500"
						:disable-touch="true"
					>
						<swiper-item
							v-for="(item, index) in info.orderList"
							:key="index"
						>
							<view class="recycle-swiper-item">
								<image
									:src="item.avatar"
									class="icon-recycle-model"
								></image>
								<view class="recycle-info">
									<view class="txt">用户{{ item.tel || '***' }}卖</view>
									<view class="model-txt red">{{ item.productName }}</view>
									<view class="txt">赚了</view>
									<view class="red">¥{{ item.price / 100 || 0 }}</view>
								</view>
								<view class="recycle-time">{{ item.time }}</view>
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		info: Object
	}
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>